import axios from './axioss'
const SERVICE = process.env.VUE_APP_SERVICE_PORTAL.replace(/"/g, '')

export function puts (url, params) {
  // let finalUrl
  // if (url.indexOf(SERVICE_FILE) === 0) {
  //   finalUrl = `${FILE_SERVICE}${url}`
  // } else {
  //   finalUrl = `${SERVICE}${url}`
  // }
  // return axios.put(finalUrl, params)
  return axios.put(`${SERVICE}${url}`, params)
}

export function deletes (url, params) {
  // let finalUrl
  // if (url.indexOf(SERVICE_FILE) === 0) {
  //   finalUrl = `${FILE_SERVICE}${url}`
  // } else {
  //   finalUrl = `${SERVICE}${url}`
  // }
  // return axios.delete(finalUrl, params)
  return axios.delete(`${SERVICE}${url}`, params)
}

export function posts (url, params, config = {}) {
  // let finalUrl
  // if (url.indexOf(SERVICE_FILE) === 0) {
  //   finalUrl = `${FILE_SERVICE}${url}`
  // } else {
  //   finalUrl = `${SERVICE}${url}`
  // }
  // return axios.post(finalUrl, params, config)
  return axios.post(`${SERVICE}${url}`, params, config)
}
